Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • trfletch 598 posts 604 karma points
    Apr 14, 2009 @ 18:52
    trfletch
    0

    Display image from child page if available and link if box is checked [SOLVED]

    Hi,

    On my Umbraco V4 website I have a page called "Clients" which will contain a list of clients, this page contains sub sections and the sub sections contain the client pages. The Client page document type has a true or false checkbox called "Case Study", if this box is checked then I want a link to the client page to be displayed next to the client name. Also the Client page document type has a logo (just a media picker) and if there is a logo then I want that to be displayed next to the name as well. Below is basically what I want the list on the Clients page to look like

    Sub section 1
    -Client A [link to client page if case study box is checked] [logo if there is one]
    -Client B [link to client page if case study box is checked] [logo if there is one]

    Sub section 2
    -Client C [link to client page if case study box is checked] [logo if there is one]
    -Client D [link to client page if case study box is checked] [logo if there is one]

    Currently I have the following XSLT which lists the contents of the sub section but always has a link to the Client page which reads "view case study", I understand that I will need to put an IF statement around this link but I'm not sure what that IF statement would be. I will then also need to add another IF statement to show the logo image if one is available. I appreciate any guidance that anyone can give:

    [code]






    [/code]

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Apr 14, 2009 @ 19:04
    Dirk De Grave
    0

    Hi,

    Checking a bool property is as easy as checking for a '1' value, just as you would with the umbracoNaviHide property, so to check whether a link to client page is required, use:

    [code]
    [/code]

    A similar construct can be used to check whether the media picker has a value assigned. In this case, check for an empty string rather than checking for a '1' value.

    [code]
    [/code]

    Be aware of the single/double quotes!!

    Hope this helps.

    Regards,
    /Dirk


  • trfletch 598 posts 604 karma points
    Apr 15, 2009 @ 12:46
    trfletch
    0

    Thanks Dirk, once again that is exactly what I am looking for. I'm getting to the point now where I know what I want to do and that it can be done I just don't know the right syntax to do it! This is where a list of all the XSLT and Umbraco commands would be handy!

Please Sign in or register to post replies

Write your reply to:

Draft